package td0.shape;

public abstract class Shape {

	private String name;

	public Shape(String name) {
		this.name = name;
	}

	public abstract double surface();

	@Override
	public String toString() {
		return name;
	}

	protected void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null)
			return false;

		if (obj == this)
			return true;

		if (!this.getClass().equals(obj.getClass()))
			return false;

		Shape s = (Shape) obj;
		return s.name.equals(this.name);
	}
}
